import { createUUID } from '../constants';
import Tick from './Tick';
import BaseNode from './BaseNode';
import Blackboard from './Blackboard';

export default class BehaviorTree {

  readonly id: string
  readonly root: BaseNode
  readonly blackboard: Blackboard
  constructor(root: BaseNode, blackboard = new Blackboard()) {
    this.id = createUUID();
    this.root = root;
    this.blackboard = blackboard
  }

  tick() {
    return new Tick(this);
  }
};
